package com.netease.course;

import java.util.Map;
import java.util.Properties;

/**
 * Created by yanfa on 2016/10/13.
 */
public class CrossHeader implements Header {
    private String color;

    private int size;

    public CrossHeader(String color,int size)
    {
        this.color = color;
        this.size = size;
    }

    public CrossHeader(Map<String,String> params)
    {
        this.color = params.get("color");
        this.size = Integer.valueOf(params.get("size"));
    }

    public CrossHeader(Properties properties)
    {
        this.color = properties.getProperty("color");
        this.size = Integer.parseInt(properties.getProperty("size"));
    }

    @Override
    public void doWork() {
        System.out.println("doWork");
    }

    @Override
    public String getInfo() {
        return this + " " + color + " " + size;
    }
}
